﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrnMall.Core;
using BrnMall.Web.Framework;

namespace BrnMall.Web.MallAdmin.models
{
	/// <summary>
	/// 分销商品信息模型
	/// </summary>
	public class DistributionProductInfoModel
	{
		/// <summary>
		/// id
		/// </summary>
		public int Id { get; set; }
		/// <summary>
		/// 商品id
		/// </summary>
		public int ProductId { get; set; }
		/// <summary>
		/// 商品名称
		/// </summary>
		public string ProductName { get; set; }
		/// <summary>
		/// 成本价
		/// </summary>
		public decimal CostPrice { get; set; }
		/// <summary>
		/// 商城价
		/// </summary>
		public decimal ShopPrice { get; set; }
		/// <summary>
		/// 分成方式
		/// </summary>
		public DistributionProductPumpedType PumpedType { get; set; }
		/// <summary>
		/// 分成值
		/// </summary>
		public decimal PumpedValue { get; set; }
		/// <summary>
		/// 分成金额
		/// </summary>
		public decimal PumpedMoney
		{
			get
			{
				switch (PumpedType)
				{
						case DistributionProductPumpedType.Fixed:
						return PumpedValue;
						case DistributionProductPumpedType.Percentage:
						return ShopPrice*PumpedValue/100;
					default:
						return 0;
				}
			}
		}
	}
	/// <summary>
	/// 分销商品设置模型
	/// </summary>
	public class DistributionProductSetModel
	{
		/// <summary>
		/// id
		/// </summary>
		public int Id { get; set; }
		/// <summary>
		/// 商品id
		/// </summary>
		public int ProductId { get; set; }
		/// <summary>
		/// 分成方式
		/// </summary>
		public DistributionProductPumpedType PumpedType { get; set; }
		/// <summary>
		/// 分成值
		/// </summary>
		public decimal PumpedValue { get; set; }
	}

	public class DistributionProductSetListModel
	{
		public List<DistributionProductInfoModel> InfoList { get; set; }
		public string SortColumn { get; set; }
		public string SortDirection { get; set; }
		public int StoreId { get; set; }
		public int CateId { get; set; }
		public int BrandId { get; set; }
		public string StoreName { get; set; }
		public string CategoryName { get; set; }
		public string BrandName { get; set; }
		public string ProductName { get; set; }
		public PageModel PageModel { get; set; }
    }
}
